ee38276bb1d9a3975e5d12829cd138ec9690fc27,packaging/src/main/java/org/neo4j/server/webadmin/rest/MonitorService.java,MonitorService,getData,#number#number#,114
Before Change
if ( start >= stop || ( stop - start ) > MAX_TIMESPAN )
{
String message = String.format( "Start time must be before stop time, and the total time span can be no bigger than %dms. Time span was %dms.", MAX_TIMESPAN, ( stop - start ) );
return buildExceptionResponse( Status.BAD_REQUEST, message, new IllegalArgumentException(), JsonRenderers.DEFAULT );
}
try
{
FetchRequest request = rrdDb.createFetchRequest(
ConsolFun.AVERAGE, start, stop,
getResolutionFor( stop - start ) );
String entity = JsonRenderers.DEFAULT.render( new
RrdDataRepresentation(
request.fetchData() ) );
return Response.ok( entity, JsonRenderers.DEFAULT.getMediaType() ).build();
} catch ( Exception e )
{
return buildExceptionResponse( Status.INTERNAL_SERVER_ERROR,
"SEVERE: Round robin IO error.", e, JsonRenderers.DEFAULT );
}
}
After Change
{
if ( start >= stop || ( stop - start ) > MAX_TIMESPAN )
{
String message = String.format( "Start time must be before stop time, and the total time span can be no bigger than %dms. Time span was %dms.", MAX_TIMESPAN, ( stop - start ) );
return output.badRequest( new IllegalArgumentException( message ) );
}
try
{
FetchRequest request = rrdDb.createFetchRequest(
ConsolFun.AVERAGE, start, stop,
getResolutionFor( stop - start ) );
return output.ok( new RrdDataRepresentation( request.fetchData() ) );
} catch ( Exception e )
{
return output.serverError( e );